#ifndef EXIFITEM_H
#define EXIFITEM_H

#include <QDeclarativeItem>

class ExifHandler;

class ExifItem : public QDeclarativeItem
{
    Q_OBJECT
    Q_PROPERTY(qreal longitude READ longitude NOTIFY longitudeChanged)
    Q_PROPERTY(qreal latitude READ latitude NOTIFY latitudeChanged)
    Q_PROPERTY(int gpsError READ gpsError NOTIFY gpsErrorChanged)

public:
    explicit ExifItem(QDeclarativeItem *parent = 0);
    
    Q_INVOKABLE void getGpsPointer(QUrl filename);

private:
    int gpsError(){return m_gpsError;}
    qreal latitude(){return m_latitude;}
    qreal longitude(){return m_longitude;}
    void launchMaps(qreal latitude, qreal longitude);

signals:

    void gpsErrorChanged();
    void longitudeChanged();
    void latitudeChanged();
    void positionChanged();

public slots:
    void gpsPositionReady(int error , qreal longitude, qreal latitude);

private:
    long        m_gpsPointer;
    int         m_gpsError;
    qreal       m_latitude;
    qreal       m_longitude;
    ExifHandler*    m_exifHandler;
};

QML_DECLARE_TYPE(ExifItem)

#endif // EXIFITEM_H
